package com.bango.flex{
	import flash.net.NetworkInfo;
	import flash.net.NetworkInterface;
	
	public class BangoStatic{
		
		public static function GetIP():String{
			try{
				var results:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();
				for (var i:int=0; i<results.length; i++){
					if(results[i].active == true)
						return results[i].addresses[0].address;
				}
			}catch(err:Error){
				return "";
			}
			return "";
		}
		
		public static function ConnectipnType(type:String):String{
			var returnValue:String = "OTHER";
			switch(type){
				case "0":{
					returnValue="OPERATOR";
					break;
				}
				case "1":{
					returnValue="WIFI";
					break;
				}
			}
			return returnValue;
		}
		public static function OperatorConnectipnType(type:String):String{
			var returnValue:String = "OTHER";
			switch(type){
					
				case "7":
					returnValue="1xRTT";
					break;      
				case "4":
					returnValue="CDMA";
					break;      
				case "2":
					returnValue="EDGE";
					break;  
				case "14":
					returnValue="eHRPD";
					break;      
				case "5":
					returnValue="EVDO rev. 0";
					break;  
				case "6":
					returnValue="EVDO rev. A";
					break;  
				case "12":
					returnValue="EVDO rev. B";
					break;  
				case "1":
					returnValue="GPRS";
					break;      
				case "8":
					returnValue="HSDPA";
					break;      
				case "10":
					returnValue="HSPA";
					break;          
				case "15":
					returnValue="HSPA+";
					break;          
				case "9":
					returnValue="HSUPA";
					break;          
				case "11":
					returnValue="iDen";
					break;
				case "13":
					returnValue="LTE";
					break;
				case "3":
					returnValue="UMTS";
					break;          
				case "0":
					returnValue="OTHER";
					break;

			}
			return returnValue;
		}
		
	}
}